import React from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';

export function mapRouteMethod(routeArr) {
  return routeArr.map(({ path, component }) => {
    return (
      <Route
        key={path}
        path={path}
        exact
        component={dynamic({
          component,
        })}
      />
    );
  });
}
